{#
Copyright (c) 2020 Andy Zhou
MIT License
#}
{% extends 'base.html' %}
{% block title %}{{ _('Manage Feedbacks') }}{% endblock %}
{% block page_content %}
    <h1>{{ _('Welcome, Administrator') }} {{ current_user.name }}</h1>
    <ul class="list-group">
        {% for feedback in feedbacks %}
            <li class="list-group-item">
                <h4>{{ feedback.title }}</h4>
                    --{{ feedback.author }}
                    <form class="form-inline" method="POST"
                        action="{{ url_for('admin.delete_feedback', id=feedback.id)}}"
                        style="float: right">
                        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
                        <button class="btn btn-danger" onclick="return confirm('Are you sure?');">
                            {{ _('DELETE') }}
                        </button>
                    </form>
                <p style="text-indent: 2em">
                    {{ feedback.body | truncate(50) }}
                </p>
            </li>
        {% endfor %}
    </ul>
{% endblock page_content %}
